

/**
 * Created by Administrator on 2016/7/7.
 */
var session_id = sessionStorage.session_id;
$("document").ready(function(){
    $("section button").click(function(){
        var user_token =  sessionStorage.user_token;
        var u_id = sessionStorage.u_id;
        var nic_name = $("section input").val();
        $.post(commonval+"/updateDoctorNicName",{
            u_id:u_id,
            user_token:user_token,
            session_id:session_id,
            device:"wap",
            nic_name:nic_name,
        },function(data){
            if (data.status == 1) {
                createWindow("修改昵称成功");
                sessionStorage["nic_name"] = nic_name;
                location.href ='changeInfo.html';
            } else if (data.status == 0) {
                createWindow(data.msg);
            }
            function createWindow(msg) {
                var window =$("<section class='showMsg'></section>");
                var show = "<p>"+msg+"</p>";
                window.append(show);
                $("body").append(window);
                setTimeout("$('.showMsg').remove()",3000);
            }

        });
    });
});
